<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="../include/laypublic.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title>投建基本信息复制单据</title>
</head>
<style>
.fieldset {
	margin-top: 5px;
	margin-bottom: 0px
}

.layui-legend {
	background-color: #5fb878;
	font-size: 15px !important;
	width: 140px;
}

.layui-form-item {
	margin-bottom: 5px;
	clear: both;
	*zoom: 1;
}

.layui-form-label {
	width: 180px;
}

.scroll-wraper {	
	width: 94.65%;
	margin-left: 1.65%;
	margin-bottom: 15px;
}

.scroll-wraper .scroll-layui-table {
	width: 100%;
	margin: 0 auto;
	overflow-x: auto;
	border-right: 1px solid #e6e6e6;
	box-shadow: 0 0 10px rgba(0, 0, 0, .12);
	display:flex;
	flex-direction:row;
}

.scroll-wraper .scroll-layui-table .scroll-layui-table-wraper-left {
    width: 12.75%;
    overflow-x: hidden;
    border-right: 1px solid #e6e6e6;
    box-shadow: 0 0 10px rgba(0, 0, 0, .12);
    background-color: blue;
}

.scroll-wraper .scroll-layui-table .scroll-layui-table-wraper-left .layui-table {
	width: 400px;
}

.scroll-wraper .scroll-layui-table .scroll-layui-table-wraper-right {
    width: 87.25%;
    overflow-x: auto;
    overflow-y: hidden;
    position: relative;
}

.scroll-wraper .scroll-layui-table .scroll-layui-table-wraper-right .scroll-layui-table-content {
    width: 3200px;
    display:block;
    background-color: #bbbbbb;
 	position:absolute;
	left:0px;
	top:0px;
}

.scroll-layui-table .layui-table {
	margin: 0px;
}
</style>
<body>
	<div class="layui-fluid">
		<div class="layui-card">
			<div class="layui-tab-item layui-show">
				<div style="padding-top: 15px;">&nbsp;</div>
				<form class="layui-form" id="addInfo_form">
					<fieldset class="layui-elem-field layui-field-title fieldset" id="baseInfo">
						<legend class="layui-btn layui-legend" style="text-align: left; cursor: default;">项目基础信息 ></legend>
						<div style="margin-top: 20px">
							<div class="layui-form-item">
								<div class="layui-inline">
									<label class="layui-form-label">申请公司</label>
									<div class="layui-input-inline">
										<input type="hidden" name="hrOrgId" value="${bindOrgId}">
										<input type="text" value="${bindOrgName}" style="border: 0px;"
											readonly="readonly" class="layui-input">
									</div>
								</div>
								<div class="layui-inline">
									<label class="layui-form-label">申请部门</label>
									<div class="layui-input-inline">
										<input type="hidden" name="hrDeptId" value="${bindDeptId}">
										<input type="text" value="${bindDeptName}" style="border: 0px;" readonly="readonly" class="layui-input">
									</div>
								</div>
								<div class="layui-inline">
									<label class="layui-form-label">申请人</label>
									<div class="layui-input-inline">
										<input type="hidden" name="hrStaffApplyId" value="${SESSION_KEY_USER_DETAIL.hrStaffId }">
										<input type="text" name="staffName" value="${staffName }"
											readonly="readonly" style="border: 0px" autocomplete="off" class="layui-input">
									</div>
								</div>
							</div>
							<div class="layui-form-item">
								<div class="layui-inline">
									<label class="layui-form-label">项目名称</label>
									<div class="layui-input-inline">
										<input type="text" name="proName" value="${buildInfo.proName}" style="border:0px;width:220px" readonly="readonly" class="layui-input">
										<input type="hidden" name="proCode" value="${buildInfo.proCode}" class="layui-input">
									</div>
								</div>
								<div class="layui-inline">
									<label class="layui-form-label">项目地点</label>
									<div class="layui-input-inline">
										<input type="hidden" name="sgCityId" value="${buildInfo.sgCityId }">
										<input type="text" name="sgCityName" value="${buildInfo.cityName }" style="border:0px;" readonly="readonly" class="layui-input">
									</div>
								</div>
								<div class="layui-inline">
									<label class="layui-form-label">总投资额（万元）</label>
									<div class="layui-input-inline">
										<input type="text" name="sumAmount" value="${buildInfo.sumAmount}" style="border:0px;" readonly="readonly" class="layui-input">
									</div>
								</div>
							</div>
							<div class="layui-form-item">
								<div class="layui-inline">
									<label class="layui-form-label">建安工程总费用（万元）</label>
									<div class="layui-input-inline">
										<input type="text" name="sumCae" value="${buildInfo.sumCae}" style="border:0px;" readonly="readonly" class="layui-input">
									</div>
								</div>
								<div class="layui-inline">
									<label class="layui-form-label">项目合同签订日期</label>
									<div class="layui-input-inline">
										<input type="text" value="<fmt:formatDate value="${buildInfo.proSignDate}" pattern="yyyy-MM-dd"/>" style="border: 0px;" 
											name="proSignDate" readonly="readonly" class="layui-input">
									</div>
								</div>
								<div class="layui-inline">
									<label class="layui-form-label">承继合同签订日期</label>
									<div class="layui-input-inline">
										<input type="text" value="<fmt:formatDate value="${buildInfo.takeSignDate}" pattern="yyyy-MM-dd"/>" style="border: 0px;" 
											name="takeSignDate" readonly="readonly" class="layui-input">
									</div>
								</div>
							</div>

							<div class="layui-form-item">
								<div class="layui-inline">
									<label class="layui-form-label">备案合同签订日期（选填）</label>
									<div class="layui-input-inline">
										<input id="baht-date" type="text" name="recordSignDate" readonly="readonly"
											value="<fmt:formatDate value="${buildInfo.recordSignDate}" pattern="yyyy-MM-dd"/>" autocomplete="off" class="layui-input">
									</div>
								</div>
								<div class="layui-inline">
									<label class="layui-form-label">总包协议签订日期</label>
									<div class="layui-input-inline">
										<input type="text" value="<fmt:formatDate value="${buildInfo.packSignDate}" pattern="yyyy-MM-dd"/>" style="border: 0px;" 
											name="packSignDate" readonly="readonly" class="layui-input">
									</div>
								</div>
								<div class="layui-inline">
									<label class="layui-form-label">建设期（年）</label>
									<div class="layui-input-inline">
										<input type="text" value="${buildInfo.buildYears }" style="border: 0px;" 
											name="buildYears" readonly="readonly" class="layui-input">
									</div>
								</div>
							</div>
							<div class="layui-form-item">
								<div class="layui-inline">
									<label class="layui-form-label">建设期描述</label>
									<div class="layui-input-inline">
										<textarea lay-verify="required" maxlength="500" 
											placeholder="请输入建设期描述" class="layui-textarea"
											style="width: 899px; height: 90px;" name="buildPeriodMemo">${buildInfo.buildPeriodMemo}</textarea>
									</div>
								</div>
							</div>

							<div class="layui-form-item">
								<div class="layui-inline">
									<label class="layui-form-label">建设期开始日期</label>
									<div class="layui-input-inline"> 
										<input id="jsq-start-date" type="text" name="buildStartDate" value="<fmt:formatDate value="${buildInfo.buildStartDate}" pattern="yyyy-MM-dd"/>"
										 lay-verify="required" placeholder="请输入建设期开始日期" class="layui-input" readonly>
									</div>
								</div>
								<div class="layui-inline">
									<label class="layui-form-label">建设期结束日期</label>
									<div class="layui-input-inline">
										<input id="jsq-end-date" type="text" name="buildEndDate" value="<fmt:formatDate value="${buildInfo.buildEndDate}" pattern="yyyy-MM-dd"/>"
										 lay-verify="required" placeholder="请输入建设期结束日期" class="layui-input" readonly>
									</div>
								</div>
							</div>
							<div class="layui-form-item">
								<div class="layui-inline">
									<label class="layui-form-label">开工日描述</label>
									<div class="layui-input-inline">
										<textarea name="openMemo" lay-verify="required"
											maxlength="500" placeholder="请输入开工日描述" class="layui-textarea"
											style="width: 899px; height: 90px;">${buildInfo.openMemo}</textarea>
									</div>
								</div>
							</div>
							<div class="layui-form-item">
								<div class="layui-inline">
									<label class="layui-form-label">运营期（年）</label>
									<div class="layui-input-inline">
										<input type="text" value="${buildInfo.omYears}" style="border: 0px;" 
											name="omYears" readonly="readonly" class="layui-input">
									</div>
								</div>
							</div>
							<div class="layui-form-item">
								<div class="layui-inline">
									<label class="layui-form-label">运营期描述</label>
									<div class="layui-input-inline">
										<textarea name="omPeriodMemo" lay-verify="required"
											maxlength="500" placeholder="请输入运营期描述" class="layui-textarea"
											style="width: 899px; height: 90px;">${buildInfo.omPeriodMemo}</textarea>
									</div>
								</div>
							</div>
							<div class="layui-form-item">
								<div class="layui-inline">
									<label class="layui-form-label">建设期利息（元）</label>
									<div class="layui-input-inline">
										<input type="text" value="${buildInfo.buildInterest}" style="border: 0px;" 
											name="buildInterest" readonly="readonly" class="layui-input">
									</div>
								</div>
								<div class="layui-inline">
									<label class="layui-form-label">建设期绩效考核说明</label>
									<div class="layui-input-inline">
										<textarea style="width: 475px; height: 90px;"
											name="assessMemo" readonly="readonly" class="layui-textarea">${buildInfo.assessMemo}</textarea>
									</div>
								</div>
							</div>
							<div class="layui-form-item">
								<div class="layui-inline">
									<label class="layui-form-label">关于工期延误条款</label>
									<div class="layui-input-inline">
										<textarea name="delayMemo" lay-verify="required"
											maxlength="1000" placeholder="请输入关于工期延误条款"
											class="layui-textarea" style="width: 899px; height: 90px;">${buildInfo.delayMemo}</textarea>
									</div>
								</div>
							</div>
						</div>
					</fieldset>
					<fieldset class="layui-elem-field layui-field-title fieldset" id="subInfo">
						<legend class="layui-btn layui-legend" style="text-align: left; cursor: default; ">子项信息 ></legend>
						<div style="margin-top: 20px">
							<div class="scroll-wraper">
								<div class="scroll-layui-table">
									<div class="scroll-layui-table-wraper-left">
										<table class="layui-table">
											<colgroup>
												<col width="200">
												<col width="200">
											</colgroup>
											<thead>
												<tr>
													<th>操作</th>
													<th></th>
												</tr>
											</thead>
											<tbody>
											<c:forEach items="${buildInfo.buildSubList}" var="sub" varStatus="status">
												<tr id="subBtnRow${sub.orderIdx}">
													<td>
														<button type="button" class="layui-btn layui-btn-sm"
															id="addSubBtn${sub.orderIdx}" onclick="addSubRow(this)">
															<i class="layui-icon">&#xe654;</i>
														</button><button type="button" class="layui-btn layui-btn-sm"
															<c:if test="${status.count == 1 && fn:length(buildInfo.buildSubList) == 1}">style="display:none"</c:if> id="delSubBtn${sub.orderIdx}"
															onclick="deleteSubRow(${sub.orderIdx})">
															<i class="layui-icon">&#xe640;</i>
														</button>
													</td>
													<td><input type="text" class="layui-input"></td>
												</tr>
											</c:forEach>
											</tbody>
										</table>
									</div>
									<div class="scroll-layui-table-wraper-right">
										<div class=" scroll-layui-table-content" >
											<table class="layui-table">
												<colgroup>
													<col width="70">
													<col width="110">
													<col width="110">
													<col width="110">
													<col width="110">
													<col width="110">
													<col width="110">
													<col width="110">
													<col width="110">
													<col width="110">
													<col width="110">
													<col width="110">
													<col width="110">
													<col width="110">
													<col width="110">
												</colgroup>
												<thead>
													<tr>
														<th>序号</th>
														<th>子项名称</th>
														<th>土地证日期</th>
														<th>用地许可证日期</th>
														<th>工程规划许可证日期</th>
														<th>施工许可证日期（开工令）</th>
														<th>内控开工日期</th>
														<th>内控竣工日期</th>
														<th>竣工验收日期</th>
														<th>竣工备案日期</th>
														<th>总工期（天）</th>
														<th>已停工天数（天）</th>
														<th>已延误天数（天）</th>
														<th>工期顺延天数（天）</th>
														<th>剩余工期天数（天）</th>
													</tr>
												</thead>
												<tbody>
												<c:forEach items="${buildInfo.buildSubList}" var="sub" varStatus="status">
													<tr id="subRow${sub.orderIdx}">
														<td><label>${sub.orderIdx}</label><input type="hidden"
															name="buildSubList[${status.index }].orderIdx" value="${sub.orderIdx}" /></td>
														<td><input type="text" name="buildSubList[${status.index }].subName"
															value="${sub.subName}" maxlength="50" autocomplete="off" lay-verify="required"
															class="layui-input"></td>
														<td><input type="text" name="buildSubList[${status.index }].landDate"
															value="<fmt:formatDate value="${sub.landDate}" pattern="yyyy-MM-dd"/>" 
															autocomplete="off" lay-verify="required" class="layui-input sub-date" readonly /></td>
														<td><input type="text" name="buildSubList[${status.index }].landLicenceDate" 
															value="<fmt:formatDate value="${sub.landLicenceDate}" pattern="yyyy-MM-dd"/>" 
															autocomplete="off" lay-verify="required" class="layui-input sub-date" readonly /></td>
														<td><input type="text" name="buildSubList[${status.index }].proPlanDate" value="<fmt:formatDate value="${sub.proPlanDate}" pattern="yyyy-MM-dd"/>"
															autocomplete="off" lay-verify="required" class="layui-input sub-date" readonly /></td>
														<td><input type="text" name="buildSubList[${status.index }].buildLicenceDate" 
															value="<fmt:formatDate value="${sub.buildLicenceDate}" pattern="yyyy-MM-dd"/>"
															autocomplete="off" lay-verify="required" class="layui-input sub-date" readonly /></td>
														<td><input type="text" name="buildSubList[${status.index }].startDate"
															value="<fmt:formatDate value="${sub.startDate}" pattern="yyyy-MM-dd"/>" 
															autocomplete="off" lay-verify="required" class="layui-input sub-date kaigong" readonly /></td>
														<td><input type="text" name="buildSubList[${status.index }].endDate"
															value="<fmt:formatDate value="${sub.endDate}" pattern="yyyy-MM-dd"/>" 
															autocomplete="off" lay-verify="required" class="layui-input sub-date jungong" readonly /></td>
														<td><input type="text" name="buildSubList[${status.index }].checkDate"
															value="<fmt:formatDate value="${sub.checkDate}" pattern="yyyy-MM-dd"/>" 
															autocomplete="off" lay-verify="required" class="layui-input sub-date" readonly /></td>
														<td><input type="text"
															name="buildSubList[${status.index }].onRecordDate"
															value="<fmt:formatDate value="${sub.onRecordDate}" pattern="yyyy-MM-dd"/>"
															autocomplete="off" lay-verify="required" class="layui-input sub-date" readonly /></td>
														<td><input type="text" value="${sub.totalDays}" maxlength="5"
															name="buildSubList[${status.index }].totalDays" lay-verify="required|intNumber"
															onblur="isNumberAndFloat(this);" autocomplete="off" class="layui-input"></td>
														<td><input type="text" value="${sub.stopDays}" maxlength="5"
															name="buildSubList[${status.index }].stopDays" lay-verify="required|intNumber"
															onblur="isNumberAndFloat(this);" autocomplete="off" class="layui-input"></td>
														<td><input type="text" value="${sub.delayedDays}" readonly style="border:0px;" maxlength="5"
															name="buildSubList[${status.index }].delayedDays" lay-verify="required"
															autocomplete="off" class="layui-input"></td>
														<td><input type="text" value="${sub.putOffDays}" maxlength="5"
															name="buildSubList[${status.index }].putOffDays" lay-verify="required|intNumber"
															onblur="isNumberAndFloat(this);" autocomplete="off" class="layui-input shunyan"></td>
														<td><input type="text" value="${sub.restDays}" maxlength="5"
															name="buildSubList[${status.index }].restDays" lay-verify="required|intNumber"
															onblur="isNumberAndFloat(this);" autocomplete="off" class="layui-input shengyu"></td>
													</tr>
													</c:forEach>
												</tbody>
											</table>
										</div>
									</div>
								</div>
							</div>
						</div>
					</fieldset>
					<fieldset class="layui-elem-field layui-field-title fieldset" id="otherInfo">
						<legend class="layui-btn layui-legend" style="text-align: left; cursor: default;">其他信息 ></legend>
						<div style="margin-top: 20px">
							<div class="layui-form-item">
								<div class="layui-inline">
									<label class="layui-form-label">备注</label>
									<div class="layui-input-inline">
										<textarea name="memo" lay-verify="required" maxlength="500"
											placeholder="请输入备注" class="layui-textarea"
											style="width: 899px; height: 90px;">${buildInfo.memo}</textarea>
									</div>
								</div>
							</div>
						</div>
					</fieldset>
					<fieldset class="layui-elem-field layui-field-title fieldset">
						<legend class="layui-btn layui-legend"
							style="text-align: left; cursor: default;">附件信息 ></legend>
						<div style="margin-top: 20px;">
							<div class="layui-form-item">
								<label class="layui-form-label" style="width: 350px;">支持pdf、excel、word、图片资料，可上传多个</label>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label">土地证（选填）</label>
								<div class="layui-input-block">
									<div class="layui-upload">
										<button type="button" class="layui-btn" id="1-upload-more">上传</button>
										<div class="layui-upload-list" id="1-upload-more-list">
											<c:forEach items="${buildInfo.buildAttList}" var="fileAtt">
						              			<c:if test="${fileAtt.types == '1' }">
						              				<div class="layui-upload-img-div" id="upload_img_${fileAtt.id }">
						              					<c:choose>
							              					<c:when test="${fileAtt.fileSuffix == '.jpg' or fileAtt.fileSuffix == '.jpeg' or fileAtt.fileSuffix == '.png'}">
								              					<img src="${fileHttpPre }/${fileAtt.filePath }" title="${fileAtt.fileName}" class="layui-upload-img">
								              				</c:when>
								              				<c:otherwise>
								              					<img src="${ctx}/resources/images/${fn:substring(fileAtt.fileSuffix,1,5)}.jpg" title="${fileAtt.fileName}" class="layui-upload-img">
								              				</c:otherwise>
						              					</c:choose>
						              					<div class="mask">
						              						<a href="javascript:void(0)" onclick="showImg('${fileHttpPre}/${fileAtt.filePath }');">查看</a>
						              						<a href="javascript:void(0)" onclick="del('${fileAtt.id}')">删除</a>
						              						<input type="hidden" value="${fileAtt.types}|${fileAtt.fileName}${fileAtt.fileSuffix }||${fileAtt.filePath }" id="fileAtt_${fileAtt.id}" name="fileAtt1" ></input>
						              					</div>
						              					<p>${fileAtt.fileName}</p>
						              				</div>
						              			</c:if>
						              		</c:forEach>
										</div>
									</div>
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label">用地许可证（选填）</label>
								<div class="layui-input-block">
									<div class="layui-upload">
										<button type="button" class="layui-btn" id="2-upload-more">上传</button>
										<div class="layui-upload-list" id="2-upload-more-list">
											<c:forEach items="${buildInfo.buildAttList}" var="fileAtt">
						              			<c:if test="${fileAtt.types == '2' }">
						              				<div class="layui-upload-img-div" id="upload_img_${fileAtt.id }">
						              					<c:choose>
							              					<c:when test="${fileAtt.fileSuffix == '.jpg' or fileAtt.fileSuffix == '.jpeg' or fileAtt.fileSuffix == '.png'}">
								              					<img src="${fileHttpPre }/${fileAtt.filePath }" title="${fileAtt.fileName}" class="layui-upload-img">
								              				</c:when>
								              				<c:otherwise>
								              					<img src="${ctx}/resources/images/${fn:substring(fileAtt.fileSuffix,1,5)}.jpg" title="${fileAtt.fileName}" class="layui-upload-img">
								              				</c:otherwise>
						              					</c:choose>
						              					<div class="mask">
						              						<a href="javascript:void(0)" onclick="showImg('${fileHttpPre}/${fileAtt.filePath }');">查看</a>
						              						<a href="javascript:void(0)" onclick="del('${fileAtt.id}')">删除</a>
						              						<input type="hidden" value="${fileAtt.types}|${fileAtt.fileName}${fileAtt.fileSuffix }||${fileAtt.filePath }" id="fileAtt_${fileAtt.id}" name="fileAtt2" ></input>
						              					</div>
						              					<p>${fileAtt.fileName}</p>
						              				</div>
						              			</c:if>
						              		</c:forEach>
										</div>
									</div>
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label">工程规划许可证（选填）</label>
								<div class="layui-input-block">
									<div class="layui-upload">
										<button type="button" class="layui-btn" id="3-upload-more">上传</button>
										<div class="layui-upload-list" id="3-upload-more-list">
											<c:forEach items="${buildInfo.buildAttList}" var="fileAtt">
						              			<c:if test="${fileAtt.types == '3' }">
						              				<div class="layui-upload-img-div" id="upload_img_${fileAtt.id }">
						              					<c:choose>
							              					<c:when test="${fileAtt.fileSuffix == '.jpg' or fileAtt.fileSuffix == '.jpeg' or fileAtt.fileSuffix == '.png'}">
								              					<img src="${fileHttpPre }/${fileAtt.filePath }" title="${fileAtt.fileName}" class="layui-upload-img">
								              				</c:when>
								              				<c:otherwise>
								              					<img src="${ctx}/resources/images/${fn:substring(fileAtt.fileSuffix,1,5)}.jpg" title="${fileAtt.fileName}" class="layui-upload-img">
								              				</c:otherwise>
						              					</c:choose>
						              					<div class="mask">
						              						<a href="javascript:void(0)" onclick="showImg('${fileHttpPre}/${fileAtt.filePath }');">查看</a>
						              						<a href="javascript:void(0)" onclick="del('${fileAtt.id}')">删除</a>
						              						<input type="hidden" value="${fileAtt.types}|${fileAtt.fileName}${fileAtt.fileSuffix }||${fileAtt.filePath }" id="fileAtt_${fileAtt.id}" name="fileAtt3" ></input>
						              					</div>
						              					<p>${fileAtt.fileName}</p>
						              				</div>
						              			</c:if>
						              		</c:forEach>
										</div>
									</div>
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label">施工许可证(开工令)（选填）</label>
								<div class="layui-input-block">
									<div class="layui-upload">
										<button type="button" class="layui-btn" id="4-upload-more">上传</button>
										<div class="layui-upload-list" id="4-upload-more-list">
											<c:forEach items="${buildInfo.buildAttList}" var="fileAtt">
						              			<c:if test="${fileAtt.types == '4' }">
						              				<div class="layui-upload-img-div" id="upload_img_${fileAtt.id }">
						              					<c:choose>
							              					<c:when test="${fileAtt.fileSuffix == '.jpg' or fileAtt.fileSuffix == '.jpeg' or fileAtt.fileSuffix == '.png'}">
								              					<img src="${fileHttpPre }/${fileAtt.filePath }" title="${fileAtt.fileName}" class="layui-upload-img">
								              				</c:when>
								              				<c:otherwise>
								              					<img src="${ctx}/resources/images/${fn:substring(fileAtt.fileSuffix,1,5)}.jpg" title="${fileAtt.fileName}" class="layui-upload-img">
								              				</c:otherwise>
						              					</c:choose>
						              					<div class="mask">
						              						<a href="javascript:void(0)" onclick="showImg('${fileHttpPre}/${fileAtt.filePath }');">查看</a>
						              						<a href="javascript:void(0)" onclick="del('${fileAtt.id}')">删除</a>
						              						<input type="hidden" value="${fileAtt.types}|${fileAtt.fileName}${fileAtt.fileSuffix }||${fileAtt.filePath }" id="fileAtt_${fileAtt.id}" name="fileAtt4" ></input>
						              					</div>
						              					<p>${fileAtt.fileName}</p>
						              				</div>
						              			</c:if>
						              		</c:forEach>
										</div>
									</div>
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label">内控开工令（选填）</label>
								<div class="layui-input-block">
									<div class="layui-upload">
										<button type="button" class="layui-btn" id="5-upload-more">上传</button>
										<div class="layui-upload-list" id="5-upload-more-list">
											<c:forEach items="${buildInfo.buildAttList}" var="fileAtt">
						              			<c:if test="${fileAtt.types == '5' }">
						              				<div class="layui-upload-img-div" id="upload_img_${fileAtt.id }">
						              					<c:choose>
							              					<c:when test="${fileAtt.fileSuffix == '.jpg' or fileAtt.fileSuffix == '.jpeg' or fileAtt.fileSuffix == '.png'}">
								              					<img src="${fileHttpPre }/${fileAtt.filePath }" title="${fileAtt.fileName}" class="layui-upload-img">
								              				</c:when>
								              				<c:otherwise>
								              					<img src="${ctx}/resources/images/${fn:substring(fileAtt.fileSuffix,1,5)}.jpg" title="${fileAtt.fileName}" class="layui-upload-img">
								              				</c:otherwise>
						              					</c:choose>
						              					<div class="mask">
						              						<a href="javascript:void(0)" onclick="showImg('${fileHttpPre}/${fileAtt.filePath }');">查看</a>
						              						<a href="javascript:void(0)" onclick="del('${fileAtt.id}')">删除</a>
						              						<input type="hidden" value="${fileAtt.types}|${fileAtt.fileName}${fileAtt.fileSuffix }||${fileAtt.filePath }" id="fileAtt_${fileAtt.id}" name="fileAtt5" ></input>
						              					</div>
						              					<p>${fileAtt.fileName}</p>
						              				</div>
						              			</c:if>
						              		</c:forEach>
										</div>
									</div>
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label">竣工验收和备案（选填）</label>
								<div class="layui-input-block">
									<div class="layui-upload">
										<button type="button" class="layui-btn" id="6-upload-more">上传</button>
										<div class="layui-upload-list" id="6-upload-more-list">
											<c:forEach items="${buildInfo.buildAttList}" var="fileAtt">
						              			<c:if test="${fileAtt.types == '6' }">
						              				<div class="layui-upload-img-div" id="upload_img_${fileAtt.id }">
						              					<c:choose>
							              					<c:when test="${fileAtt.fileSuffix == '.jpg' or fileAtt.fileSuffix == '.jpeg' or fileAtt.fileSuffix == '.png'}">
								              					<img src="${fileHttpPre }/${fileAtt.filePath }" title="${fileAtt.fileName}" class="layui-upload-img">
								              				</c:when>
								              				<c:otherwise>
								              					<img src="${ctx}/resources/images/${fn:substring(fileAtt.fileSuffix,1,5)}.jpg" title="${fileAtt.fileName}" class="layui-upload-img">
								              				</c:otherwise>
						              					</c:choose>
						              					<div class="mask">
						              						<a href="javascript:void(0)" onclick="showImg('${fileHttpPre}/${fileAtt.filePath }');">查看</a>
						              						<a href="javascript:void(0)" onclick="del('${fileAtt.id}')">删除</a>
						              						<input type="hidden" value="${fileAtt.types}|${fileAtt.fileName}${fileAtt.fileSuffix }||${fileAtt.filePath }" id="fileAtt_${fileAtt.id}" name="fileAtt6" ></input>
						              					</div>
						              					<p>${fileAtt.fileName}</p>
						              				</div>
						              			</c:if>
						              		</c:forEach>
										</div>
									</div>
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label">工期签证（选填）</label>
								<div class="layui-input-block">
									<div class="layui-upload">
										<button type="button" class="layui-btn" id="7-upload-more">上传</button>
										<div class="layui-upload-list" id="7-upload-more-list">
											<c:forEach items="${buildInfo.buildAttList}" var="fileAtt">
						              			<c:if test="${fileAtt.types == '7' }">
						              				<div class="layui-upload-img-div" id="upload_img_${fileAtt.id }">
						              					<c:choose>
							              					<c:when test="${fileAtt.fileSuffix == '.jpg' or fileAtt.fileSuffix == '.jpeg' or fileAtt.fileSuffix == '.png'}">
								              					<img src="${fileHttpPre }/${fileAtt.filePath }" title="${fileAtt.fileName}" class="layui-upload-img">
								              				</c:when>
								              				<c:otherwise>
								              					<img src="${ctx}/resources/images/${fn:substring(fileAtt.fileSuffix,1,5)}.jpg" title="${fileAtt.fileName}" class="layui-upload-img">
								              				</c:otherwise>
						              					</c:choose>
						              					<div class="mask">
						              						<a href="javascript:void(0)" onclick="showImg('${fileHttpPre}/${fileAtt.filePath }');">查看</a>
						              						<a href="javascript:void(0)" onclick="del('${fileAtt.id}')">删除</a>
						              						<input type="hidden" value="${fileAtt.types}|${fileAtt.fileName}${fileAtt.fileSuffix }||${fileAtt.filePath }" id="fileAtt_${fileAtt.id}" name="fileAtt7" ></input>
						              					</div>
						              					<p>${fileAtt.fileName}</p>
						              				</div>
						              			</c:if>
						              		</c:forEach>
										</div>
									</div>
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label">其他附件（选填）</label>
								<div class="layui-input-block">
									<div class="layui-upload">
										<button type="button" class="layui-btn" id="8-upload-more">上传</button>
										<div class="layui-upload-list" id="8-upload-more-list">
											<c:forEach items="${buildInfo.buildAttList}" var="fileAtt">
						              			<c:if test="${fileAtt.types == '8' }">
						              				<div class="layui-upload-img-div" id="upload_img_${fileAtt.id }">
						              					<c:choose>
							              					<c:when test="${fileAtt.fileSuffix == '.jpg' or fileAtt.fileSuffix == '.jpeg' or fileAtt.fileSuffix == '.png'}">
								              					<img src="${fileHttpPre }/${fileAtt.filePath }" title="${fileAtt.fileName}" class="layui-upload-img">
								              				</c:when>
								              				<c:otherwise>
								              					<img src="${ctx}/resources/images/${fn:substring(fileAtt.fileSuffix,1,5)}.jpg" title="${fileAtt.fileName}" class="layui-upload-img">
								              				</c:otherwise>
						              					</c:choose>
						              					<div class="mask">
						              						<a href="javascript:void(0)" onclick="showImg('${fileHttpPre}/${fileAtt.filePath }');">查看</a>
						              						<a href="javascript:void(0)" onclick="del('${fileAtt.id}')">删除</a>
						              						<input type="hidden" value="${fileAtt.types}|${fileAtt.fileName}${fileAtt.fileSuffix }||${fileAtt.filePath }" id="fileAtt_${fileAtt.id}" name="fileAtt8" ></input>
						              					</div>
						              					<p>${fileAtt.fileName}</p>
						              				</div>
						              			</c:if>
						              		</c:forEach>
										</div>
									</div>
								</div>
							</div>
						</div>
					</fieldset>
					<div class="layui-form-item"
						style="position: fixed ! important; right: 30px; bottom: 45%; z-index: 10000;">
						<div class="layui-input-block">
							<button
								class="layui-btn layui-bg-blue layui-btn-normal layui-btn-lg  layui-btn-radius"
								type="button" lay-submit lay-filter="addInfo_form_submit"
								id="addInfo_form_submit">
								<i class="layui-icon layui-icon-ok layuiadmin-button-btn"></i>提交
							</button>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
<script>
function getDaysBetween(dateString1, dateString2) {
	var startDate = Date.parse(dateString1);
	var endDate = Date.parse(dateString2);
	var days = (endDate - startDate) / (1 * 24 * 60 * 60 * 1000);
	return days;
}
String.prototype.toInt = function() {
	if (this == '') {
		return 0;
	}
	return parseInt(this);
}

//静态资源路径前缀
var staticPath = '${fileHttpPre}';
var stateJSON = <infopub:dicJson groupNo="A00010028" />;

layui.config({
	base : '${ctx}/resources/layuiadmin/' //静态资源所在路径
		}).extend({
			index : 'lib/index' //主入口模块
		}).use([ 'index', 'set', 'upload', 'element', 'laydate' ],function() {
			var $ = layui.$, form = layui.form, element = layui.element, laydate = layui.laydate, upload = layui.upload;
			// 正则校验
			form.verify({
				//验证汉字
				CHS : [ /^[\u0391-\uFFE5]+$/, '只能输入汉字' ],
				//大于等于0的正整数
				intNumber : [ /^[0-9]\d*$/, '请输入正确的数字' ],
				//数字只能有两位小数
				floatNumber : [/^([-]?)([0-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/,'请输入正确的数字' ],
				//数字大于0，并只能有两位小数
				floatAmount : [/^([1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/, '请输入正确的数字' ]
				//var pattern=/^((\d+\.\d*[1-9]\d{1})|(\d*[1-9]\d*\.\d{2}))$/; 
			});
			var laydate = layui.laydate;
			laydate.render({
				elem : '#baht-date'
				,trigger: 'click'
			});
			var jsqStart = laydate.render({
				elem : '#jsq-start-date'
				,trigger: 'click'
				,done: function(value, date){
		  	        //更新结束日期的最小日期
		  	        jsqEnd.config.min = lay.extend({}, date, {
		  	          month: date.month - 1
		  	        });
		  	        
		  	        //自动弹出结束日期的选择器
		  	       jsqEnd.config.elem[0].focus();
		  	    }
		  	});
			var jsqEnd =laydate.render({
				elem : '#jsq-end-date'
				,trigger: 'click'
				,done: function(value, date){
		  	        //更新开始日期的最大日期
		  	        jsqStart.config.max = lay.extend({}, date, {
		  	          month: date.month - 1
		  	        });
		  	    }
		  	});
			
			lay('.sub-date').each(function() {
				laydate.render({
					elem : this,
					trigger : 'click',
					format : 'yyyy-MM-dd',
					done : function(value, date) {
						var $tr = $( this.elem) .parents( 'tr');
						var $shengyu = $tr.find('input.shengyu'), shengyu = 0;
						var $jungong = $tr.find('input.jungong'), jungong = $jungong.val();
						var $kaigong = $tr.find('input.kaigong'), kaigong = $kaigong.val();
						var $shunyan = $tr.find('input.shunyan'), shunyan = $shunyan.val().toInt();
						if (!!kaigong && !!jungong) {
							shengyu = getDaysBetween( kaigong, jungong) + shunyan;
							$shengyu.val(shengyu);
						}
					}
				});
			});
			
			$('.layui-table').on('blur', 'input.shunyan', function() {
					var $tr = $(this).parents('tr');
					var $shengyu = $tr .find('input.shengyu'), shengyu = 0;
					var $jungong = $tr .find('input.jungong'), jungong = $jungong .val();
					var $kaigong = $tr .find('input.kaigong'), kaigong = $kaigong .val();
					var $shunyan = $tr .find('input.shunyan'), shunyan = $shunyan .val().toInt();
					if (!!kaigong && !!jungong) {
						shengyu = getDaysBetween(kaigong, jungong)+ shunyan;
						$shengyu.val(shengyu);
					}
			});

			var uploadRender = function(id) {
			upload.render({
				elem : '#' + id + '-upload-more',
				url : basePath+'/buildInfo/uploadAtt/',
				data : {
					types : id
				},
				multiple : true,
				accept : 'file',
				acceptMime : 'application/zip,application/x-rar-compressed,image/jpeg,image/png,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/pdf',
				before : function(obj) {
					layer.load();
				},
				done : function(res) {
					if (res.code > 0) {
						layer.closeAll('loading');
						return layer.msg(res.msg, {
							icon : 7
						});
					}
					if (res.entity != null&& res.entity.length > 0) {
						for ( var i in res.entity) {
							var preProject = res.entity[i];
							var arr = preProject
									.split("|");
							var imgSrc = "";
							var suffix = arr[1].substring(arr[1].lastIndexOf(".") + 1,arr[1].length);
							if (suffix == 'jpg'|| suffix == 'png') {
								imgSrc = "${fileHttpPre}/"+arr[3];
							} else {
								imgSrc = "${ctx}/resources/images/"+suffix+".jpg";
							}
							$('#'+id+'-upload-more-list').append('<div class="layui-upload-img-div" id="upload_img_'+arr[2]+'"><img src="'+imgSrc+'" title="'+ arr[1] +'" class="layui-upload-img"><div class="mask"><a href="javascript:void(0)" onclick="showImg(\''+"${fileHttpPre}"+arr[3]+'\');">查看</a><a href="javascript:void(0)" onclick="del(\''+arr[2]+'\')";>删除</a></div><p>'+arr[1]+ '</p><input type="hidden" value="'+preProject+'" id="fileAtt_'+arr[2]+'" name="fileAtt'+id+'" ></input></div>');
						}
					}
				},
				allDone : function(obj) {
					layer.closeAll('loading');
				},
				error : function() {
					layer.closeAll('loading');
					layer.msg("上传失败，请稍后再试~", {
						icon : 7
					});
				}
			});
			}
			for (var i = 1; i < 9; i++) {
				uploadRender(i);
			}

		//公司select监听
		form.on('select(add_select_orgId)',
			function(data) {
				var orgId = data.value;
				$('#add_selectDept').html('');
				//获取公司下的所有部门
				$.ajax({
					type : "POST", //提交方式  
					url : "${ctx}/dept/getAllDeptByOrgId",//路径  
					data : {
						"orgId" : orgId
					},//数据，这里使用的是Json格式进行传输  
					success : function( result) {//返回数据根据结果进行相应的处理 
						if (result.flag == true) {
							var strBuffer = "";
							strBuffer += '<option value="">请选择</option>';
							layui.$.each(result.depts,function(i,item) {
								if (item.id != null && item.deptName != null) {
									strBuffer += '<option value='+item.id+'>'+ item.deptName+ '</option>';
								}
							});
							$('#add_selectDept').append(strBuffer);
							form.render();
						} else {
							layer.msg('数据通信异常~',{icon : 0});
						}
					}
				});
			});
			//项目地点select监听
		    form.on('select(add_select_proId)', function(data){
		    	var id = data.value;
		    	$('#query-input-sgCityId').val('');
				$('#sgCityName').val('');
				$('#query-input-amout').val('');
				$('#query-input-sumCae').val('');
		    	$('#query-input-proSignDate').val('');
		    	$('#query-input-takeSignDate').val('');
		    	$('#baht-date').val('');
		    	$('#query-input-packSignDate').val('');
		    	$('#query-input-buildYears').val('');
		    	$('#query-input-omYears').val('');
		    	$('#query-input-buildInterest').val('');
		    	$('#query-input-assessMemo').val('');
		    	form.render();
		    	if(id==''||id==null){
		    		//layer.msg('请选择项目名称',{icon: 0});
		    		return;
		    	}else{
		    		getProPlotProId(id); 
		    	}					    	  	
		    });

			//项目渠道select监听
			form.on('select(add_selectFromChannel)', function(data) {
				var fromChannel = data.value;
				if (fromChannel == '1') {
					$("#linkPower").removeAttr("lay-verify");
					$("#linkPowerDiv").hide();
				} else {
					$("#linkPower").attr("lay-verify","required");
					$("#linkPowerDiv").show();
				}
			});			

			//监听提交
			form.on('submit(addInfo_form_submit)',function(data) {
				$("#addInfo_form_submit").removeAttr("lay-submit").removeClass("layui-bg-blue").addClass("layui-btn-disabled");
				layer.load();//loading
				//提交 Ajax 成功后，静态更新表格中的数据
				$.ajax({
					type : 'post',
					url : basePath + '/buildInfo/save',
					data : $('#addInfo_form').serialize(),
					success : function(
							result) {
						if (result.success) {
							layer.closeAll('loading'); //关闭loading
							layer.msg('提交单据成功~',{
								icon : 1
							});
							//两秒后关闭当前页面
							setTimeout(function() {
								/**
								 * 查找父菜单，并刷新
								 */
								var topDoc = $(window.top.document);
								var path = basePath+'/buildInfo/list';
								// 获取页面名称
								var name = topDoc.find(".layui-nav-item [lay-href^='"+path+"']").text();
								if (name == '' || name == null) {
									name = '投建基本信息';
								}
								window.parent.layui.index.openTabsPage(path,name);
								var iframe = window.parent.layui.admin
										.tabsBody(window.parent.layui.admin.tabsPage.index).find(".layadmin-iframe");
								iframe[0].contentWindow.location.reload(true);

								/**
								 * 关闭当前页
								 */
								var currPath = basePath+'/buildInfo/toCopy';
								var layid = topDoc.find("li[lay-id^='"+ currPath+ "']").attr('lay-id');
								window.parent.layui.element.tabDelete('layadmin-layout-tabs',layid);//关闭当前页
							},2000);
						} else {
							layer.closeAll('loading'); //关闭loading
							$("#addInfo_form_submit").removeClass("layui-btn-disabled").addClass("layui-bg-blue").attr("lay-submit","");
							layer.msg(result.msg,{icon : 7});
						}
					}
				});
			});
			// data-type事件
			$('.layui-btn.layuiadmin-btn-admin').on('click',function() {
				var type = $(this).data('type');
				active[type] ? active[type].call(this): '';
			});
		});

		function deleteSubRow(id) {
			var $ = layui.$;
			layui.layer.confirm('确定删除？', {
				icon : 3,
				title : '提示'
			}, function(index) {
				var thisid = $("tr[id=subRow" + id + "]").find("label").html();
				thisid = parseInt(thisid);
				$("tr[id^='subRow']").each(function() {
					var tId = $(this).attr("id").substring(6);
					tId = parseInt(tId);
					var thisIndex = $("tr[id=subRow" + tId + "]").find(
							"label").html();
					thisIndex = parseInt(thisIndex);
					var nextId = thisIndex - 1;
					if (thisIndex > thisid) {
						$("tr[id=subRow" + tId + "]").find("label").html(nextId);
						$("tr[id=subRow" + tId + "]").find("input[type=hidden]").val(nextId);
						$(this).find("input").each(function(){
				  			var inputName = $(this).attr("name").split(".");
				  			var inpName = "buildSubList["+(nextId-1)+"].";
				  			$(this).attr("name",inpName+inputName[1]);
				  		});
					}
				});
				$("#subRow" + id + " ,#subBtnRow" + id).remove();
				if ($("button[id^='delSubBtn']").length == 1) {
					$("button[id^='delSubBtn']").each(function() {
						$(this).attr("style", "display:none");
					});
				}
				layui.layer.close(index);
			});
		}

		function addSubRow(t) {
			var $ = layui.$;
			var delBtnCount = $("button[id^='delSubBtn']").length;
			if (delBtnCount == 1) {
				$("button[id^='delSubBtn']").each(function() {
					$(this).removeAttr("style");
				});
			}
			var thisid = $(t).attr("id").substring(9);
			var $btnRow = $("tr[id=subBtnRow" + thisid + "]");
			var $row = $("tr[id=subRow" + thisid + "]");
			thisid = $row.find("label").html();
			thisid = parseInt(thisid);

			var nextIndex = parseInt(thisid) + 1;
			var maxInd = $("tr[id^='subRow']").length;
			$("tr[id^='subRow']").each(function() {
				var tId = $(this).attr("id").substring(6);
				tId = parseInt(tId);
				if (tId > maxInd) {
					maxInd = parseInt(tId);
				}
				var thisIndex = $(this).find("label").html();
				thisIndex = parseInt(thisIndex);
				var nextId = thisIndex + 1;
				if (thisIndex > thisid) {
					$("tr[id=subRow" + tId + "]").find("label").html(nextId);
					$("tr[id=subRow" + tId + "]").find("input[type=hidden]").val(nextId);
					$(this).find("input").each(function(){
			  			var inputName = $(this).attr("name").split(".");
			  			var inpName = "buildSubList["+thisIndex+"].";
			  			$(this).attr("name",inpName+inputName[1]);
			  		});
				}
			});

var ind = maxInd + 1;
var html=[]
html.push('<tr id="subRow'+ind+'" >')
html.push('<td><label>'+nextIndex+'</label><input type="hidden" name="buildSubList['+thisid+'].orderIdx" value="'+nextIndex+'" /></td>');
html.push('<td><input type="text" name="buildSubList['+thisid+'].subName" value="" maxlength="50" autocomplete="off" lay-verify="required" class="layui-input"></td>');
html.push('<td><input type="text" name="buildSubList['+thisid+'].landDate" value="" autocomplete="off" lay-verify="required" class="layui-input sub-date" readonly /></td>');
html.push('<td><input type="text" name="buildSubList['+thisid+'].landLicenceDate" value="" autocomplete="off" lay-verify="required" class="layui-input sub-date" readonly /></td>');
html.push('<td><input type="text" name="buildSubList['+thisid+'].proPlanDate" value="" autocomplete="off" lay-verify="required" class="layui-input sub-date" readonly /></td>');
html.push('<td><input type="text" name="buildSubList['+thisid+'].buildLicenceDate" value="" autocomplete="off" lay-verify="required" class="layui-input sub-date" readonly /></td>');
html.push('<td><input type="text" name="buildSubList['+thisid+'].startDate" value="" 	autocomplete="off" lay-verify="required" class="layui-input sub-date kaigong" readonly /></td>');
html.push('<td><input type="text" name="buildSubList['+thisid+'].endDate" value="" 	autocomplete="off" lay-verify="required" class="layui-input sub-date jungong" readonly /></td>');
html.push('<td><input type="text" name="buildSubList['+thisid+'].checkDate" value="" 	autocomplete="off" lay-verify="required" class="layui-input sub-date" readonly /></td>');
html.push('<td><input type="text" name="buildSubList['+thisid+'].onRecordDate" value="" autocomplete="off" lay-verify="required" class="layui-input sub-date" readonly /></td>');
html.push('<td><input type="text" value="" maxlength="5" name="buildSubList['+thisid+'].totalDays" 	lay-verify="required|intNumber" onblur="isNumberAndFloat(this);" autocomplete="off" class="layui-input"></td>');
html.push('<td><input type="text" value="" maxlength="5" name="buildSubList['+thisid+'].stopDays"	lay-verify="required|intNumber" onblur="isNumberAndFloat(this);" autocomplete="off" class="layui-input"></td>');
html.push('<td><input type="text" value="0" readonly style="border:0px;" maxlength="5" name="buildSubList['+thisid+'].delayedDays" lay-verify="required" autocomplete="off" class="layui-input"></td>');
html.push('<td><input type="text" value="" maxlength="5" name="buildSubList['+thisid+'].putOffDays" lay-verify="required|intNumber" onblur="isNumberAndFloat(this);" autocomplete="off" class="layui-input shunyan"></td>');
html.push('<td><input type="text" value="" maxlength="5"  name="buildSubList['+thisid+'].restDays"	lay-verify="required|intNumber" onblur="isNumberAndFloat(this);" autocomplete="off" class="layui-input shengyu"></td>');
html.push('</tr>');
			
			var medalHtml = html.join('');
			$row.after(medalHtml);

			medalHtml = '';
			medalHtml += '<tr id="subBtnRow'+ind+'">';
			medalHtml += '<td><button type="button" class="layui-btn layui-btn-sm" id="addSubBtn'
					+ ind + '" onclick="addSubRow(this)">';
			medalHtml += '<i class="layui-icon">&#xe654;</i></button>';
			medalHtml += '<button type="button" class="layui-btn layui-btn-sm" id="delSubBtn'
					+ ind
					+ '" onclick="deleteSubRow('
					+ ind
					+ ')" ><i class="layui-icon">&#xe640;</i>';
			medalHtml += '</button></td><td><input type="text" class="layui-input"></td></tr>';
			$btnRow.after(medalHtml);

			layui.form.render();
			lay('.sub-date').each(function() {
				laydate = layui.laydate;
				laydate.render({
					elem : this,
					trigger : 'click',
					format : 'yyyy-MM-dd',
					done : function(value, date) {
						var $tr = $( this.elem) .parents( 'tr');
						var $shengyu = $tr.find('input.shengyu'), shengyu = 0;
						var $jungong = $tr.find('input.jungong'), jungong = $jungong.val();
						var $kaigong = $tr.find('input.kaigong'), kaigong = $kaigong.val();
						var $shunyan = $tr.find('input.shunyan'), shunyan = $shunyan.val().toInt();
						if (!!kaigong && !!jungong) {
							shengyu = getDaysBetween( kaigong, jungong) + shunyan;
							$shengyu.val(shengyu);
						}
					}
				});
			});
		}

		//删除文件
		function del(index) {
			layui.$("#fileAtt_" + index).remove();
			layui.$("#upload_img_" + index).remove();
		}

		//根据url查看文件
		function showImg(url) {
			var openWin = window.open(url,'','left=410,height=768, width=1024, top=200,  toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');
		}

		//'请输入正确数字，且必须为正整数！'
		function isNumberAndFloat(str) {
			var $ = layui.$, form = layui.form
			if (str.value == '' || str.value == null) {
				return;
			}
			var rgx = /^[0-9]\d*$/;

			var boolrgx = rgx.test(str.value);// true 
			if (boolrgx) {
				return true;
			} else {
				str.value =0;
				layer.msg('请输入正确数字，且必须是正整数！');
				return false;
			}
		}
	</script>
</body>
</html>

